package com.tjwx.controller;

import com.tjwx.service.ClassifyService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "/service")
public class ServiceController {
    private final static Logger logger = LoggerFactory.getLogger(ServiceController.class);

    @Autowired
    ClassifyService classifyService;

    /**
     * 查询分类
     * @return
     */
    @RequestMapping(method = {RequestMethod.OPTIONS, RequestMethod.GET},value = "/getClassify",produces = "application/json;charset=UTF-8")
    @ResponseBody
//    @RequiresAuthentication
    public Object getClassify() {
        return classifyService.getClassify();
    }

    /**
     * 查询分类详情
     * @return
     */
    @RequestMapping(method = {RequestMethod.OPTIONS, RequestMethod.GET},value = "/getDetailByClassifyid",produces = "application/json;charset=UTF-8")
    @ResponseBody
//    @RequiresAuthentication
    public Object getDetailByClassifyid(@RequestParam(value = "classifyid") String classifyid) {
        return classifyService.getDetailByClassifyid(classifyid);
    }

}
